package com.diaohw.module.system.obj.mapstruct;

import com.diaohw.module.system.obj.entity.LoginLog;
import com.diaohw.module.system.obj.vo.LoginLogVo;
import com.diaohw.platform.remote.auth.obj.bo.LoginLogBO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p>
 * 用户登录日志 类型转换
 * </p>
 *
 * @author D-Hw
 * @since 2024-07-08
 */
@Mapper
public interface AccountLoginLogMapstruct {

    AccountLoginLogMapstruct INSTANCE = Mappers.getMapper(AccountLoginLogMapstruct.class);

    /**
     * dto to entity
     */
    LoginLog toEntity(LoginLogBO dto);

    /**
     * entity to dto
     */
    LoginLogBO entityToDto(LoginLog entity);


    LoginLogVo entityToVo(LoginLog dto);

    @IterableMapping(elementTargetType = LoginLogVo.class)
    List<LoginLogVo> entityToVo(List<LoginLog> list);

}

